jQuery(function(){
    //退款详情
    //$("#refund_detail").click(function(){
    //    var order_sn = $(this).attr('order_sn');
    //    if(/^\d{15}$/.test(order_sn)==false)return false;
    //    ajax_form("refund_detail", "退款详情", "/personal/order/refunddetail/"+order_sn,"800",false);
    //});
    $(".J_deleteOrder").click(function(){
        if(confirm("确定要删除交易吗?"))
        {
            $.getJSON('/member/order/delete/sn/'+$(this).attr('order_sn'),function(data){
                if(data.status ==1)
                {
                    floatNotify.simple('删除成功', "", 2e3);
                    setTimeout("window.location.reload()",2000);
                }
                else
                {
                    alert(data.msg);
                }
            });
        }
    })
    $(".J_closeOrder").click(function(){
        if(confirm("确定要取消交易吗?"))
        {
            $.getJSON('/member/order/close/sn/'+$(this).attr('order_sn'),function(data){
                if(data.status == 1)
                {
                    floatNotify.simple('取消成功', "", 2e3);
                    setTimeout("window.location.reload()",2000);
                }
                else
                {
                    alert(data.msg);
                }
            });
        }
    })

    $(".J_payOrder").click(function(){
        var url = '/order/pay/sn/'+$(this).attr('order_sn')+".html";
        location.href= url;
    });

    $(".J_activeOrder").click(function(){
        var url = '/member/order/activate/sn/'+$(this).attr('order_sn')+".html";
        location.href= url;
    });

    //$(".buy_again").click(function(){
    //    var url = '/personal/order/buyagain/'+$(this).attr('order_sn');
    //    location.href= url;
    //});
})